package ch04Spring.demo;

import ch04Spring.User;
import ch04Spring.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class aopTest {
    public void aopTest(){
        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService service=(UserService) context.getBean("userService");
        User user=new User();
        user.setId(1);
        user.setUsername("test");
        user.setPassword("123456");
        user.setEmail("test@xxx.com");
        service.save(user);
    }

    public static void main(String[] args) {
        aopTest aopTest=new aopTest();
        aopTest.aopTest();
    }
}
